package com.csc.attributes;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class UserDAO {
	public boolean checkLogin(String username, String password)
			throws SQLException {

		try {
			Connection connection = Connector.getConnection();
			String sql = "select * from users where username = ?";
			PreparedStatement stm = connection.prepareStatement(sql);
			stm.setString(1, username);
			
			ResultSet rs = stm.executeQuery();

			if (rs.next()) {
				return true;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return false;

	}
}
